import React, { Component } from 'react';
import {Form,Input, Button,Radio} from 'antd';
const FormItem = Form.Item;

class AddForm4 extends Component{
    constructor(props){
        super(props);
        this.form= this.props.form;
    }
    render(){
        const getFieldDecorator = this.props.form.getFieldDecorator ;
        const formItemLayout = {//不知道这个是干嘛用的，随便写写
            labelCol: {
              xs: { span: 24 },
              sm: { span: 5 },
            },
            wrapperCol: {
              xs: { span: 24 },
              sm: { span: 12 },
            }
          };

        return(
            <Form layout="inline" className="addForm">
                    {getFieldDecorator('type',{
                        initialValue:(this.props.type)
                    })(<Input type="hidden"/>)}
                    
                    {getFieldDecorator('id',{
                        initialValue:(this.props.editdata.id?this.props.editdata.id:'')
                    })(<Input type="hidden"/>)}
                    {getFieldDecorator('key',{
                        initialValue:(this.props.keyid)
                    })(<Input type="hidden"/>)}
                <FormItem label="开票抬头" >
                    {getFieldDecorator('title',{
                        initialValue:(this.props.editdata.title?this.props.editdata.title:''),
                        rules:[{
                            required:true,
                            message:'请填写开票抬头'
                        }]
                    })(<Input />)}
                </FormItem>
                <FormItem label="开票税号" >
                    {getFieldDecorator('texnum',{
                        initialValue:this.props.editdata.texnum?this.props.editdata.texnum:''
                    })(<Input />)}
                </FormItem>
                <FormItem label="手机号" >
                    {getFieldDecorator('recv_phone',{
                        initialValue:this.props.editdata.recv_phone?this.props.editdata.recv_phone:''
                    })(<Input />)}
                </FormItem>
                <FormItem label="邮箱" >
                    {getFieldDecorator('recv_email',{
                        initialValue:this.props.editdata.recv_email?this.props.editdata.recv_email:''
                    })(<Input />)}
                </FormItem>
            </Form>
        )
    }
}
class AddForm2 extends Component{
    constructor(props){
        super(props);
        this.form= this.props.form;
    }
    render(){
        const getFieldDecorator = this.props.form.getFieldDecorator ;
        return(
            <Form layout="inline" className="addForm"  >
                    {getFieldDecorator('type',{
                        initialValue:(this.props.type)
                    })(<Input type="hidden"/>)}
                    
                    {getFieldDecorator('id',{
                        initialValue:(this.props.editdata.id?this.props.editdata.id:'')
                    })(<Input type="hidden"/>)}
                    {getFieldDecorator('key',{
                        initialValue:(this.props.keyid)
                    })(<Input type="hidden"/>)}
                <FormItem label="开票抬头" >
                    {getFieldDecorator('title',{
                        initialValue:(this.props.editdata.title?this.props.editdata.title:''),
                        rules:[{
                            required:true,
                            message:'请填写开票抬头'
                        }]
                    })(<Input />)}
                </FormItem>
                <FormItem label="开票税号" >
                    {getFieldDecorator('texnum',{
                        initialValue:this.props.editdata.texnum?this.props.editdata.texnum:''
                    })(<Input />)}
                </FormItem>
            </Form>
        )
    }
}
export {AddForm4,AddForm2}